using Sustainalytics.ClientDW.Entities;
using Sustainalytics.ESG.Entities;
using System.Collections.Generic;

namespace Sustainalytics.ESGRatings.BusinessLogic
{
    public class AssessmentsManager
    {
        private readonly Dictionary<int, RPAssessment> _assesements;

        public AssessmentsManager()
        {
            _assesements = new Dictionary<int, RPAssessment>
            {
                {1, new RPAssessment {Id = 1, Name = "Leader"}},
                {2, new RPAssessment {Id = 2, Name = "Outperformer"}},
                {3, new RPAssessment {Id = 3, Name = "Average Performer"}},
                {4, new RPAssessment {Id = 4, Name = "Underperformer"}},
                {5, new RPAssessment {Id = 5, Name = "Laggard"}},
                {0, new RPAssessment {Id = 0, Name = "Unknown"}}
            };

        }


        public RPAssessment GetById(int id)
        {
            RPAssessment asessement;
            var cappedId = id % 5 + 1;

            if (_assesements.TryGetValue(cappedId, out asessement))
                return asessement;

            return null;
        }



    }
}
